package com.SmartCare.controller.manager;


import com.SmartCare.common.Result;
import com.SmartCare.pojo.homeInfo.CareHomeContacts;
import com.SmartCare.service.homeInfo.ContactsService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 养老院联系方式表 前端控制器
 */
@RestController
@RequestMapping("/contacts")
@Api(tags = "管理端养老院联系方式接口")
public class ContactsController {
    @Resource
    ContactsService cs;

    //添加联系方式
    @PostMapping("/add")
    @Operation(summary = "添加联系方式", description = "添加联系方式对象，返回对象的id")
    public Result add(@RequestBody CareHomeContacts careHomeContacts){
        return cs.add(careHomeContacts);
    }
    //修改联系方式
    @PutMapping("/edit")
    @Operation(summary = "修改联系方式", description = "根据id对联系方式对象进行修改")
    public Result edit(@RequestBody CareHomeContacts careHomeContacts){
        return cs.edit(careHomeContacts);
    }
}

